:- multifile option/2, builtin/1.
:- dynamic active/1.

modeh(active(+molecule), [name(h)]).
modeb(1, atom(+molecule,-atomid,#element), [name(a)]).
%:- modeb(9, bond(+molecule,+atomid,-atomid,#bondtype)).
modeb(bond(+molecule,+atomid,#element,-atomid,#element,#bondtype), [name(b)]).

atom(M, Atom_ID, Elem):-
  atm(M, Atom_ID, _, Elem, _, _, _, _). % using the 4th argument as element is more specific than using the third
%  atm(M, Atom_ID, Elem, _, _, _, _, _).

bond(M, A1, E1, A2, E2, BT):-
  atom(M, A1, E1),
  atom(M, A2, E2),
  bond(M, A1, A2, BT).


option(max_body_literals, 6).
option(max_num_rules, 1).
%option(strategy, progol).
option(number_of_solutions, 1).
option(single_seed_ratio, 300).
option(solution_pool, 1).
option(max_depth, 500).
option(single_seed, true).
option(cover_loop, true).
option(strategy, progol).
option(loop_threshold, 5).
option(xvalidation_folds, 10).
option(score_before_condition, false).
option(ordering, true).
option(max_cl_iterations, 20).


atomid(_X).
molecule(_X).
element(_X).

%builtin(float(_)).

bondtype(_X). % :- float(X).

%:-set(maximum_singletons_in_hypothesis, 1).
%:-set(maximum_literals_in_hypothesis, 10).
%:-set(cross_validation_folds, 5).
%:-set(evalfn, laplace).
%:-set(evalfn, coverage).

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Interesting notice: In this dataset laplace and coverage evaluation functions have better results
% than compression. That is because there are relatively few examples (only 560) and since the interesting
% hypothesis are relatively large (about 6 literals) the cost of the pos coverage - neg coverage -
% num literals in hypothesis can easily become negative because pos score - neg score is only slightly positive
% (e.g. 8-2). To overcome that, we set example inflation to a high value (e.g. 10, i.e. multiplying each
% example weight by 10). This way the pos score - neg score for the same hypothesis would be 60. If such
% an hypothesis had 10 literals it would before be discarded but now accepted.
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


%:-set(example_inflation, 10). % increasing inflation so that compression is a good measure
%%:-set(minpos, 20). % minimum positive score to consider a rule
%%:-set(verbose,1).
%
%:-p_consult([atombond, examples]).